<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">

  <xsl:import href="../../sys/resolver.xsl"/>
	
	<xsl:variable name="docPath" select="$basePath"/>

  <xsl:template match="uri[@ext = 'html']">
  	<access obj="{$docPath}/document" scope="view">
  		<param key="ref" value="{$dataPath}/{@relativeName}"/>
  	</access>
  </xsl:template>
  
  <xsl:template match="uri[@ext = 'pdf']">
  	<access obj="{$docPath}/style/fo/pdf" scope="view">
  		<param key="ref" value="{$dataPath}/{@relativeName}"/>
    </access>
  </xsl:template>
  
	<!-- map special paths -->
	
	<xsl:template match="uri[matches(@relative, '^(.*/)?image/')]" priority="2">
		<access obj="{$dataPath}/{@relativeName}" scope="view"/>
	</xsl:template>
	
	<xsl:template match="uri[matches(@relative, '^(.*/)?media/')]" priority="2">
		<access obj="{$dataPath}/{@relativeName}" scope="view"/>
	</xsl:template>
	
	<!-- special views -->
	
	<xsl:template match="uri[@relative = 'Intro.html']" priority="2">
		<access obj="/livcos.org/web/Intro" scope="view">
			<param key="ref" value="{$dataPath}/{@relativeName}"/>
		</access>
	</xsl:template>
	
	<xsl:template match="uri[@full = '/livcos.org/web/index.html']" priority="2">
    <access obj="/livcos.org/web/index" scope="view"/>
  </xsl:template>
  
  <xsl:template match="uri[@full = '/livcos.org/web/data.html']" priority="2">
    <access obj="/livcos.org/web/data" scope="view"/>
  </xsl:template>
  
</xsl:stylesheet>